package com.feiyu.mapper;


import com.feiyu.pojo.Emp;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.util.List;

@Mapper
public interface EmpMapper {

    /**
     * 查询所有员工
     *
     * @return
     */

    List<Emp> list(@Param("name") String name, @Param("gender") Short gender,
                   @Param("start") LocalDate start, @Param("end") LocalDate end);


    @Select("select id, username, password, name, gender, image, job, entrydate, dept_id, create_time, update_time " +
            "      from emp where username=#{username} and password =#{password}")
    Emp login(Emp emp);


    void deleteByIds(@Param("ids") String[] ids);


    @Delete("delete  from  emp  where dept_id=#{deptId}")
    void deleteByDeptId(Integer deptId);



}
